//
// Created by hjie on 23-6-11.
//
#pragma once
#include <string>
#include <cstring>
#include <memory>
#include "media_process.h"
#include "./../../loop_event/loop_event_define.h"

class LoopEvent;

class MediaProcessClient
{
public:
    MediaProcessClient(LoopEvent * loop_event);
    ~MediaProcessClient();
    void ChangeIpPort(const std::string & ip, uint16_t port);
    void ProcessMediaData();
    bool IsRunning() { return m_status; }
private:
    LoopEvent * m_loop_event;
    std::string m_remote_ip;
    uint16_t    m_remote_port;
private:
    std::shared_ptr<MediaProcess> m_media_process;
    UdpClient * m_udp_client;
private:
    std::thread m_thd;
    bool m_status;
};
